Skip to content

Fix FlowGraphSettings: change TSubclassOf --> TSoftClassPtr#355

Merged
MothDoctor merged 2 commits intoMothCocoon:5.xfrom
Chen-Gary:fix_hard_ref
Apr 6, 2026
Merged

Fix FlowGraphSettings: change TSubclassOf --> TSoftClassPtr#355
MothDoctor merged 2 commits intoMothCocoon:5.xfrom
Chen-Gary:fix_hard_ref

Conversation

@Chen-Gary
Copy link
Copy Markdown
Contributor

I encountered a bug when dealing with hard reference (TSubclassOf) and BP class. Hard reference to BP class may cause BP compile error. See below:

Steps to Reproduce

  • Create a new plugin with a module (runtime; LoadingPhase: Default). Define a simple UStruct, FMyDummyStruct, in this module.
"Modules": [
{
	"Name": "DummyPlugin",
	"Type": "Runtime",
	"LoadingPhase": "Default"
}
]
USTRUCT(BlueprintType)
struct FMyDummyStruct
{
	GENERATED_BODY()
};
  • Create a BP FlowNode, FN_Test, in the project Content folder. In FN_Test, declare a variable with type FMyDummyStruct. So far, everything works just fine.
image
  • In Project Settings, reference FN_Test in OverridenNodeCategories
image

Since OverridenNodeCategories is a hard reference to the BP FlowNode (TMap<TSubclassOf<class UFlowNode>, FString>), when I restart the project, the following errors occurs:

image image

To fix this error, I changed hard reference (TSubclassOf) in FlowGraphSettings to TSoftClassPtr.

Let me know if I was wrong.

@MothDoctor MothDoctor self-assigned this Mar 9, 2026
@MothDoctor MothDoctor merged commit d242fa9 into MothCocoon:5.x Apr 6, 2026
@MothDoctor
Copy link
Copy Markdown
Contributor

Yes, it's a good fix. In general, TSubclassOf should be avoided to prevent automatic loading of unnecessary assets. I understood some time ago, but didn't look at UFlowGraphSettings.

Change integrated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants